#include "form3.h"
#include "ui_form3.h"
#include <QDebug>
#include <QPropertyAnimation>

int Scroll_Width;

Form3::Form3(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form3)
{
    ui->setupUi(this);

//    setLED(ui->label_5, 1, 16);  //变红
    setLED(ui->label_5, 2, 16);  //变绿

    setLED(ui->label_8, 2, 16);  //变绿

    ui->scrollAreaWidgetContents_5->setMinimumSize(QSize(278,580)); //设置滚动轴的有效区域
    Scroll_Width = ui->scrollAreaWidgetContents_5->height(); //初始值是580
    qDebug() << Scroll_Width;


}

Form3::~Form3()
{
    delete ui;
}


bool iswiedet_1=true;
void Form3::on_pushButton_6_clicked()
{
    if(iswiedet_1==true)  // 收起
    {
        ui->widget_3->setVisible(false);
        ui->scrollAreaWidgetContents_5->setFixedHeight(ui->scrollAreaWidgetContents_5->height()-50); //设置滚动轴的有效区域，当前数值-固定值
        Scroll_Width = ui->scrollAreaWidgetContents_5->height();
        qDebug() << Scroll_Width;
        iswiedet_1=false;
        return;
    }
    ui->widget_3->setVisible(true); // 放下
    Scroll_Width = ui->scrollAreaWidgetContents_5->height();
    ui->scrollAreaWidgetContents_5->setFixedHeight(ui->scrollAreaWidgetContents_5->height()+50); //设置滚动轴的有效区域
    Scroll_Width = ui->scrollAreaWidgetContents_5->height();
    qDebug() << Scroll_Width;
    iswiedet_1=true;



}



bool iswiedet_2=true;
void Form3::on_pushButton_7_clicked()
{
    if(iswiedet_2==true)
    {
        ui->widget_4->setVisible(false);
        ui->widget->setVisible(false);
        ui->scrollAreaWidgetContents_5->setFixedHeight(ui->scrollAreaWidgetContents_5->height()-200); //设置滚动轴的有效区域，当前数值-固定值
        Scroll_Width = ui->scrollAreaWidgetContents_5->height();
        qDebug() << Scroll_Width;
        iswiedet_2=false;
        return;
    }
    ui->widget_4->setVisible(true);
    ui->widget->setVisible(true);
    ui->scrollAreaWidgetContents_5->setFixedHeight(ui->scrollAreaWidgetContents_5->height()+200); //设置滚动轴的有效区域，当前数值-固定值
    Scroll_Width = ui->scrollAreaWidgetContents_5->height();
    qDebug() << Scroll_Width;
    iswiedet_2=true;

}

bool iswiedet_3=true;
void Form3::on_pushButton_8_clicked()
{
    if(iswiedet_3==true)
    {
        ui->widget_5->setVisible(false);
        ui->widget_6->setVisible(false);
        ui->scrollAreaWidgetContents_5->setFixedHeight(ui->scrollAreaWidgetContents_5->height()-200); //设置滚动轴的有效区域，当前数值-固定值
        Scroll_Width = ui->scrollAreaWidgetContents_5->height();
        qDebug() << Scroll_Width;
        iswiedet_3=false;
        return;
    }
    ui->widget_5->setVisible(true);
    ui->widget_6->setVisible(true);
    ui->scrollAreaWidgetContents_5->setFixedHeight(ui->scrollAreaWidgetContents_5->height()+200); //设置滚动轴的有效区域，当前数值-固定值
    Scroll_Width = ui->scrollAreaWidgetContents_5->height();
    qDebug() << Scroll_Width;
    iswiedet_3=true;
}

